home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / workbench werkzeuge / scherz programme / clicker / source / prefs.c < prev    next >
C/C++ Source or Header  |  1996-04-07  |  1KB  |  45 lines

  1. /*  File:         prefs.c
  2.  *  Created:      20-10-95
  3.  *  Updated:      30-12-95
  4.  *  Version:      1.0
  5.  *  Project:      Clicker
  6.  *  Owner:        Jeroen Vermeulen
  7.  *  Requirements: KickStart V39+
  8.  *  Legal:        PD
  9.  *  Status:       Release
  10.  */
  11.  
  12. #include <exec/types.h>
  13.  
  14. #include "prefs.h"
  15.  
  16. /* This global volatile variable enables asynchronous communication between
  17.  * processes.  New settings for sample volume, click length and pitch will be
  18.  * stored into this struct, so the key-click routine will feed the new data into
  19.  * its audio request on the next key click.
  20.  */
  21. volatile struct SoundSettings ClickPrefs = { FALSE, TRUE, 400, 50, 5 };
  22.  
  23.  
  24. /* CopySoundPrefs():
  25.  * Copies a SoundSettings structure, like CopyMem() but slightly safer in every-
  26.  * day use.  It is volatile-safe and const-friendly, and also sets the
  27.  * destination's newsettings flag.  NULL arguments are *not* safe.
  28.  */
  29. void CopySoundPrefs(volatile const struct SoundSettings *const src,
  30.                     volatile       struct SoundSettings *const dst)
  31. {
  32.   dst->period      = src->period;
  33.   dst->volume      = src->volume;
  34.   dst->cycles      = src->cycles;
  35.  
  36. #ifdef    NOCLICKMOUSE
  37.   dst->ClickMouse  = FALSE;
  38. #else  /* NOCLICKMOUSE */
  39.   dst->ClickMouse  = src->ClickMouse;
  40. #endif /* NOCLICKMOUSE */
  41.  
  42.   dst->newsettings = TRUE;
  43. }
  44.  
  45.